home *** CD-ROM | disk | FTP | other *** search
- 0010 401000 Put X into 1000 (Sets 1001 - 1004 to zero)
- 0011 001000 Load accumulator with X
- 0012 250048 If X is zero jump to halt instruction
- 0013 240017 If X is negative, skip next 3 instructions
- 0014 001501 Load +1
- 0015 031502 Store at S (sign)
- 0016 260022 Branch unconditionally around next 5
- 0017 001503 Load -1
- 0018 031502 Store at S
- 0019 001500 Load zero
- 0020 021000 Subtract X (This makes a negative X positive)
- 0021 031000 Store back at X
- 0022 001501 Load 1
- 0023 030002 I=1 using index register 2
- 0024 001000 Load X
- 0025 360008 Shift it right 8
- 0026 031001 Store at Y
- 0027 001001 Load Y (Note this is the start of a loop)
- 0028 151504 Multiply by 8
- 0029 031001 Store at Y
- 0030 001000 Load X
- 0031 2370000 Shift left by I (Contents of register 2)
- 0032 360008 Shift right 8 (This isolates an octal digit)
- 0033 011001 Add previous Y
- 0034 031001 Store back at Y
- 0035 000002 Load I
- 0036 011501 Add 1
- 0037 030002 Store at I
- 0038 021505 Subtract 9 to see if done
- 0039 240027 If negative repeat loop
- 0040 001000 Load X
- 0041 151502 Multiply by sign
- 0042 031000 Store at X
- 0043 001001 Load Y
- 0044 151502 Multiply by sign
- 0045 031001 Store at Y
- 0046 411000 Print X, Y
- 0047 260010 Branch back to start
- 0048 500000 Halt
- 1500 0 Zero
- 1501 1 One
- 1503 -1 Negative one
- 1504 8 Eight
- 1505 9 Nine
- 9999 10 End of code and starting location